import { createApp } from 'vue'//导入createApp方法,该方法用于创建vue实例对象
import App from './App.vue'//导入根组件,基于根组件创建实例对象

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import zhCn from "element-plus/es/locale/lang/zh-cn"
import 'element-plus/dist/index.css'//👆导入element-plus系列组件
import 'element-plus/theme-chalk/dark/css-vars.css'//导入element-plus组件相关的黑暗主题样式表

//import  '@arcgis/core/assets/esri/themes/light/main.css'
//import '@arcgis/core/assets/esri/themes/dark/main.css'
import esriConfig from '@arcgis/core/config'
esriConfig.portalUrl="/arcgisOnline"//👆配置portal地址

import * as echarts from "echarts"
window.echarts=echarts//导入echarts相关组件

import axios from 'axios'
import VueAxios from 'vue-axios'//导入axios相关的组件

import {createRouter,createWebHashHistory} from 'vue-router'//导入两个路由相关的方法
import Home from './components/Home/Home.vue'//导入Home组件
import 变量插值 from "./components/模板应用/变量插值.vue";
import 双向绑定 from './components/模板应用/双向绑定.vue'
import 条件渲染 from './components/模板应用/条件渲染.vue'

import 循环渲染 from './components/模板应用/循环渲染.vue'
const router=createRouter({//创建路由对象
    history:createWebHashHistory(),
    routes:[//路由映射数组
        {path:'/' , component:Home},
        {path:'/Home' , component:Home},
        {path:'/变量插值',component:变量插值},
        {path:'/双向绑定',component:双向绑定},
        {path:"/条件渲染",component:条件渲染},
        {path:"/循环渲染",component:循环渲染},
    ]
})

import store from './store/index.js'//导入store仓库对象

const app=createApp(App)//基于根组件创建实例对象

for (const [key,component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key,component)
}//实例对象创建后,批量导入element-plus组件


app.use(ElementPlus,{locale: zhCn})
app.use(store)
app.use(VueAxios,axios)
app.use(router)
app.mount('#app')//挂载实例到DOM节点
